#include "RenderLayer.h"

namespace k2graphics
{

RenderLayer::RenderLayer()
{
	sizeMode = SIZE_MODE_NONE;
	hw = 1.0f;
	hh = 1.0f;
	invLayerParallax = 1.0;
}

RenderLayer::~RenderLayer()
{
	if(objects)
		delete[] objects;
}

void RenderLayer::initMax(int maxObjs)
{
	maxObjects = maxObjs;
	numObjects = 0;
	objects = new RenderData*[maxObjects];
}

void RenderLayer::addObj(RenderData* obj)
{
	objects[numObjects] = obj;
	++numObjects;
}

void RenderLayer::clear()
{
	numObjects = 0;
}

void RenderLayer::setParallax(double invParallax)
{
	invLayerParallax = invParallax;
}

void RenderLayer::deleteObjects()
{
	for(int i = 0; i < numObjects; ++i)
		delete objects[i];

	numObjects = 0;
}

}